<template>
  <div>
    <div class="box flex justify-between align-center flex-wrap">
      <div class="flex justify-start align-center flex-wrap">
        <el-avatar class="mr-20" :size="70" :src="avatar"></el-avatar>
        <div>
          <div class="mb-10 size-24 weight-bold"> 早上好，{{ name }}，开始您一天的工作吧！ </div>
          <div class="color-9"> 今日晴，20℃ - 32℃！ </div>
        </div>
      </div>
      <div class="flex justify-center">
        <div class="flex-col justify-center align-end mlr-30">
          <span class="color-9"> 待办 </span>
          <span class="size-20 mt-5">2/10</span>
        </div>
        <div class="flex-col justify-center align-end mlr-30">
          <span class="color-9"> 项目 </span>
          <span class="size-20 mt-5">8</span>
        </div>
        <div class="flex-col justify-center align-end mlr-30">
          <span class="color-9"> 团队 </span>
          <span class="size-20 mt-5">300</span>
        </div>
      </div>
    </div>
    <el-card shadow="hover" class="m-20">
      <div slot="header" class="clearfix">
        <span class="size-16">流量趋势</span>
      </div>
      <line-chart />
    </el-card>
    <el-row :gutter="20" style="margin: 0 10px">
      <el-col :lg="8" :md="12" :xs="24">
        <el-card shadow="hover" class="mb-20">
          <div slot="header">
            <span class="size-16">转化率</span>
          </div>
          <rising-sun />
        </el-card>
      </el-col>
      <el-col :lg="8" :md="12" :xs="24">
        <el-card shadow="hover" class="mb-20">
          <div slot="header">
            <span class="size-16">访问来源</span>
          </div>
          <visit-source />
        </el-card>
      </el-col>
      <el-col :lg="8" :md="12" :xs="24">
        <el-card shadow="hover" class="mb-20">
          <div slot="header">
            <span class="size-16">成交占比</span>
          </div>
          <sales-product-pie />
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import LineChart from './components/LineChart'
import RisingSun from './components/RisingSun'
import VisitSource from './components/VisitSource'
import SalesProductPie from './components/SalesProductPie'

export default {
  name: 'Dashboard',
  components: {
    LineChart,
    RisingSun,
    VisitSource,
    SalesProductPie
  },
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['avatar', 'name'])
  },
  mounted() {},
  methods: {}
}
</script>

<style scoped>
.color-9 {
  color: #999999;
}

.el-card {
  border: none;
}
</style>
